package com.qd.pay.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qd.pay.model.OrderBody;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.BlobInputStreamTypeHandler;

import java.io.ByteArrayInputStream;

/**
 * @author sjk
 */
public interface OrderBodyMapper extends BaseMapper<OrderBody> {

    @Select("select certificate from org_wxconfig where appid = #{appId, jdbcType=VARCHAR}")
    @Results(id = "cMap", value = {
            @Result(column = "certificate", property = "certificate", typeHandler = BlobInputStreamTypeHandler.class)
    })
    ByteArrayInputStream getCertificate(@Param("appId") String appId);
}


